/**
 * 
 */
(function() {
	CodeMirror.TemplateHint = function(editor) {
		// Find the token at the cursor
		var cur = editor.getCursor(), token = editor.getTokenAt(cur);
		var hints = [' '];
		if (token.state.current == 'text') {
			hints = ['<#comment#>', '{{var}}', '{%if %}', '{%for %}'];
		} else {
			switch (token.state.current) {
			case 'comment':
				hints.push(token.string + ' #}');
				break;
			case 'var':
				hints.push(token.string + ' }}');
				break;
			case 'block':
				hints.push(token.string+ ' %}');
				break;
			}
		}
		return {
			list : hints,
			from : {
				line : cur.line,
				ch : token.start
			},
			to : {
				line : cur.line,
				ch : token.end
			}
		};
	};
})();